
import Trade;
import Resources;

class Industry(Trade.Trader):
	def __init__(self, city):
		self.city = city;
		
		# Max production per turn, in units of goods
		self.production = 0;

	# Process the goods
	def Process(self):
		

class PrimaryIndustry(Industry):
	def __init__(self, city):
		Industry.__init__(self, city);
		
		# Map of resources to commodities produced.
		self.productions = {};
	
	def Process(self):
		nProd = self.production * Control.GetInst().game.turnDelta;
		for r, c in self.productions.iteritems():
			n = city.GetResourceAllocation(self, r, nProd);
			if n > 0:
				self.Produce(c, n);
				nProd -= n;
	
		
class Farmer(PrimaryIndustry):
	def __init__(self, city):
		PrimaryIndustry.__init__(self, city);
		
		self.productions = {
			'Farmland': 'Food'
		};

class Fisher(PrimaryIndustry):
	def __init__(self, city):
		PrimaryIndustry.__init__(self, city);
		
		self.productions = {
			'Fish': 'Food'
		};

class Logger(PrimaryIndustry):
	def __init__(self, city):
		PrimaryIndustry.__init__(self, city);
		
		self.productions = {
			'Trees': 'Wood'
		};
		
class Quarryman(PrimaryIndustry):
	def __init__(self, city):
		PrimaryIndustry.__init__(self, city);
		
		self.productions = {
			'Stone': 'Bricks'
		};

class Brickmaker(PrimaryIndustry):
	def __init__(self, city):
		PrimaryIndustry.__init__(self, city);
		
		self.productions = {
			'Clay': 'Bricks'
		};
		